package com.anolesoft.amljmes.fourteenDispatch.service.impl;

import com.anolesoft.amljmes.fourteenDispatch.dto.MesWpgProcessDto;
import com.anolesoft.amljmes.fourteenDispatch.service.info.MesWpgProcessService;
import com.anolesoft.amljmes.fourteenDispatch.service.mapper.MesWpgProcessServiceMapping;
import com.anolesoft.amljmes.fourteenDispatch.controller.MesWpgProcessController;
import com.anolesoft.yr.util.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MesWpgProcessServiceImpl implements MesWpgProcessService {
    @Autowired
    MesWpgProcessServiceMapping mesWpgProcessServiceMapping;


    @Override
    public List<MesWpgProcessDto> queryWpgProcessInfo(MesWpgProcessController.DemoVO demoVO) {
        List<MesWpgProcessDto> queryWpgProcessDto=mesWpgProcessServiceMapping.queryWpgProcessSQL(demoVO);
        return queryWpgProcessDto;
    }

    @Override
    public int addMesWpgProcess(MesWpgProcessDto inFoDtoParam) {
        int count = mesWpgProcessServiceMapping.addMesWpgProcess(inFoDtoParam);
        return count;
    }

    @Override
    public int updateMesWpgProcess(MesWpgProcessDto inFoDtoParam) {
        int count = mesWpgProcessServiceMapping.updateMesWpgProcess(inFoDtoParam);
        return count;
    }

    @Override
    public int deleteMesWpgProcess(MesWpgProcessDto inFoDtoParam) {
        int count = mesWpgProcessServiceMapping.deleteMesWpgProcess(inFoDtoParam);
        return count;
    }

    @Override
    public int delete(List<String> objuids) {
        int count = 0;
        for(String objuid : objuids) {
            count += mesWpgProcessServiceMapping.delete(objuid);
        }
        return count;
    }

    @Override
    public int isMesWpgProcessName(MesWpgProcessDto inFoDtoPara) {
        int count = mesWpgProcessServiceMapping.isMesWpgProcessName(inFoDtoPara);
        return count;
    }

    @Override
    public List<MesWpgProcessDto> gongxuNameAll() {
        List<MesWpgProcessDto> gongxuNameAll=mesWpgProcessServiceMapping.gongxuNameAll(SecurityUtils.getLoginUser().getFacCode());
        return gongxuNameAll;
    }
}
